/* 
 * File:   EntityContactInfo.h
 * Author: RedEyedKiller
 *
 * Created on 19 Ιούνιος 2011, 1:08 μμ
 */

#ifndef ENTITYCONTACTINFO_H
#define	ENTITYCONTACTINFO_H

#include "../Vector2.h"

namespace EntitySystem
{
class Entity;
}

class ScriptRegister;

namespace physicsSystem
{
namespace PhysicsInternals
{

class EntityContactInfo
{
public:
    EntityContactInfo(EntitySystem::Entity* collidedWith_
            , const Math::Vector2F & contactNormal_
            , const Math::Vector2F & relativeVelocity_);
private:
    /**
     * The other entity of the entity pair that collided with the owner of this.
     */
    EntitySystem::Entity* collidedWith;

    /**
     * The contact normal describing the contact from the owners perspective.
     */
    Math::Vector2F contactNormal;
    
    /**
     * The relative velocity between the two objects.
     */
    Math::Vector2F relativeVelocity;

public:

    void SetContactNormal(const Math::Vector2F& contactNormal);

    Math::Vector2F GetContactNormal();

    void SetCollidedWith(EntitySystem::Entity* collidedWith);

    EntitySystem::Entity* GetCollidedWith();
    
    Math::Vector2F GetRelativeVelocities() const;
private:
    /**
     * Like the normal geter of collidedWith property but used only by the scripts.
     * @return 
     */
    EntitySystem::Entity& scGetCollidedWith() const;
};

};
};

#endif	/* ENTITYCONTACTINFO_H */

